


*******************************************
** Previously Heard of "Citizens' Assembly"
*******************************************

* Open data
use "Ireland_Data.dta", replace
tab heardofca2 // 88%




***********
** Figure 2
***********


* Open data
use "Ireland_Data.dta", replace


* Graph preparations
gen var = "Procedural Fairness" in 1/6
replace var = "Decision Acceptance" in 7/12
gen treat = _n in 1/6
replace treat = _n-6 in 7/12
gen pe = 0 if treat == 1
gen se = .


* Regressions
reg fair i.expgroup
forvalues i = 2/6 {
	replace pe = _b[`i'.expgroup] if var == "Procedural Fairness" & treat == `i'
	replace se = _se[`i'.expgroup] if var == "Procedural Fairness" & treat == `i'
}
reg decacc i.expgroup
forvalues i = 2/6 {
	replace pe = _b[`i'.expgroup] if var == "Decision Acceptance" & treat == `i'
	replace se = _se[`i'.expgroup] if var == "Decision Acceptance" & treat == `i'
}

* Further graph preparations
gen y = treat
gen pe2 = pe
sum pe if var == "Procedural Fairness" & treat == 4
replace pe2 = r(mean) if var == "Procedural Fairness" & y == 5
sum pe if var == "Procedural Fairness" & treat == 5
replace pe2 = r(mean) if var == "Procedural Fairness" & y == 4
sum pe if var == "Decision Acceptance" & treat == 4
replace pe2 = r(mean) if var == "Decision Acceptance" & y == 5
sum pe if var == "Decision Acceptance" & treat == 5
replace pe2 = r(mean) if var == "Decision Acceptance" & y == 4
gen se2 = se
sum se if var == "Procedural Fairness" & treat == 4
replace se2 = r(mean) if var == "Procedural Fairness" & y == 5
sum se if var == "Procedural Fairness" & treat == 5
replace se2 = r(mean) if var == "Procedural Fairness" & y == 4
sum se if var == "Decision Acceptance" & treat == 4
replace se2 = r(mean) if var == "Decision Acceptance" & y == 5
sum se if var == "Decision Acceptance" & treat == 5
replace se2 = r(mean) if var == "Decision Acceptance" & y == 4

* CIs
gen lower = pe2 - (1.96 * se2)
gen upper = pe2 + (1.96 * se2)

* Outcome labels
gen var_num = 1 if var == "Procedural Fairness"
replace var_num = 2 if var == "Decision Acceptance"
labmask var_num, values(var)

* Numerical results as marker labels
gen mlabel2a = ""
gen mlabel2b = ""

gen temp1 = pe2
gen temp2 = lower
gen temp3 = upper
format %03.2f temp1 temp2 temp3
tostring temp1 temp2 temp3, replace usedisplayformat force
gen ci = "[" + temp2 + ", " + temp3 + "]"
replace mlabel2a = temp1 in 2/6
replace mlabel2b = ci in 2/6
replace mlabel2a = temp1 in 8/12
replace mlabel2b = ci in 8/12
drop temp1 temp2 temp3 ci

* Graph
twoway ///
	(scatter y pe2, mcolor(black) msymbol(o) msize(medium) mlabel(mlabel2a) mlabposition(12) mlabangle(horizontal) mlabsize(small)) ///
	(rspike lower upper y, lcolor(black) horizontal) ///
	, ///
	by(var_num, noixlabel ixtitle graphregion(fcolor(white) lcolor(white)) bgcolor(white) note("",) legend(off) scale(1.2)) ///
	ytitle("") yscale(noline range(0.8 6.2) reverse) ///	
	ylabel(1 "No mini-public (control)" 2 "Representative mini-public" 3 "Small demographic bias" 4 "Small attitudinal bias" 5 "Large demographic bias" 6 "Large attitudinal bias", angle(horizontal) nogrid) ///
	xtitle("Treatment effect", margin(small))  ///
	xline(0, lwidth(thin) lpattern(solid) lcolor(black) extend) ///
	xlabel(-0.2(0.2)0.4,) xmlabel(-0.2(0.1)0.4,) xscale(noline) ///
	subtitle(, size(medlarge) align(middle) margin(bottom) nobox fcolor(white))  ///
	graphregion(fcolor(white) ifcolor(white) lcolor(white)) plotregion(fcolor(white) lcolor(black)) bgcolor(white) ///
	scheme(s2mono) xsize(7) ysize(4) 
gr_edit .b1title.draw_view.setstyle, style(no)
gr_edit .plotregion1.xaxis1[1].style.editstyle majorstyle(tickstyle(show_labels(yes))) editcopy





******************************
** Factual Manipulation Checks
******************************

* Open data
use "Ireland_Data.dta", replace

* % correctly remembered final decision
tab fmc_final_corr	// 86%

* % correctly remembered exact treatment condition
tab fmc_treat_corr // 67%

* % correctly remembered whether there was a mini-public
foreach var of varlist expgroup fmc_treat {
gen temp_`var' = 1 if `var' == 1
replace temp_`var' = 2 if inrange(`var',2,6)
}
gen fmc_treat_corr2 = (temp_expgroup == temp_fmc_treat) if fmc_treat != .
drop temp_expgroup temp_fmc_treat
tab fmc_treat_corr2 // 93%

* Of those exposed to DMP, % correctly remembered whether it was biased or not
foreach var of varlist expgroup fmc_treat {
gen temp_`var' = 1 if `var' == 1
replace temp_`var' = 2 if `var' == 2
replace temp_`var' = 3 if inrange(`var',3,6)
}
gen fmc_treat_corr3 = (temp_expgroup == temp_fmc_treat) if fmc_treat != .
drop temp_expgroup temp_fmc_treat
tab fmc_treat_corr3 if expgroup != 1 // 87%


